package com.bwie.message.service.impl;

import com.alibaba.fastjson.JSON;
import com.bwie.common.domain.request.UserReqSendDelMessage;
import com.bwie.message.service.MessageService;
import com.bwie.message.utils.SendSmsUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.xml.crypto.Data;
import java.util.Date;
import java.util.HashMap;

/**
 * @Author Junchen_N1
 * @Date 2025/6/17 12:08
 * @ClassName MessageServiceImpl
 * @Description TODO
 */
@Service
public class MessageServiceImpl implements MessageService {

    @Autowired
    private SendSmsUtils sendSmsUtils;

    /**
     * 阿里大鱼发送消息
     * @param userReqSendDelMessage
     */
    @Override
    public void sendDelFriendMsg(UserReqSendDelMessage userReqSendDelMessage) {
        sendSmsUtils.sendSms(userReqSendDelMessage.getTel(), JSON.toJSONString(new HashMap<String, String>() {{
            put("code", "您好！您的好友【" + userReqSendDelMessage.getUsername() + "】，在【" + new Date() + "】将您删除");
        }}));
    }
}
